package CMinusScanner;

import java.util.ArrayList;

/**
 * @author Adam Plisch and Austin Klob
 * File: Token.java
 * Created: February 2012
 * Copyright Cedarville University, its Computer Science
 * faculty, and the authors. All rights reserved.
 *
 * Description: This class allows for
 * the manipulation of token objects.
*/

public class Token {
    
    public enum TokenType {
        //Reserved Words
        INT_TOKEN,
        IF_TOKEN,
        ELSE_TOKEN,
        WHILE_TOKEN,
        VOID_TOKEN,
        RETURN_TOKEN,
        //Types
        LETTER_TOKEN, //a |..| z | A | .. | z
        DIGIT_TOKEN, //0 |..| 9
        ID_TOKEN, //letter letter*
        NUM_TOKEN, //digit digit*      
        //Symbols
        EOF_TOKEN,
        PLUS_TOKEN,
        MINUS_TOKEN,
        MULTIPLY_TOKEN,
        DIVIDE_TOKEN,
        LESSTHAN_TOKEN,
        LESSTHAN_EQUALTO_TOKEN,
        GREATERTHAN_TOKEN,
        GREATERTHAN_EQUALTO_TOKEN,
        COMPARISON_TOKEN,
        NOTEQUAL_TOKEN,
        EQUAL_TOKEN,
        SEMICOLON_TOKEN,
        COMMA_TOKEN,
        LEFTPAREN_TOKEN,
        RIGHTPAREN_TOKEN,
        LEFTSQUAREBRACE_TOKEN,
        RIGHTSQUAREBRACE_TOKEN,
        LEFTSQUIGGLEBRACE_TOKEN,
        RIGHTSQUIGGLEBRACE_TOKEN,
        OPENCOMMENT_TOKEN,
        CLOSECOMMENT_TOKEN,
    }
    
    private TokenType tokenType;
    private Object tokenData;

    public Token(){
        this (null, null);
    }
    //Constructor
    public Token (TokenType type) {
        this (type, null);
    }

    public Token (TokenType type, ArrayList<Character> data) {
        tokenType = type;
        tokenData = data;
    }
    
    //Gets and Sets
    public TokenType getType(){
        return tokenType;
    }
    
    public void setType(TokenType newType){
        tokenType = newType;
    }
    
    public Object getData(){
        return tokenData;
    }
    
    public void setData(String data){
        tokenData = data;
    }
}